package cn.edu.stu.mapper;

import cn.edu.stu.bean.MicArtist;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface MicArtistMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(MicArtist record);

    MicArtist selectByPrimaryKey(Integer id);

    List<MicArtist> selectAll();

    int updateByPrimaryKey(MicArtist record);

    //

    @Select("select id from mic_artist where name = #{name}")
    Integer selectByName(@Param("name") String name);

    @Select("select id,name from mic_artist where name like concat(#{name},'%')")
    List<MicArtist> selectArtistsWithLeftName(String name);

    @Select("select count(*) from mic_artist")
    Integer countAll();

    List<MicArtist> selectArtistsWithName(@Param("name") String name,@Param("ids") List<Integer> excludedId);


}